﻿using FreeSql.DataAnnotations;
using System;

namespace FYSJcrm.Core.Model.PermManage
{
    [Table(Name = "FYSJ_Manager")]
    public class ManagerEntity : BaseEntity
    {
        public int RoleId { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [Column(StringLength = 50, IsNullable = false)]
        public string UserName { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Column(StringLength = 255, IsNullable = false)]
        public string Password { get; set; }

        /// <summary>
        /// 盐值
        /// </summary>
        [Column(StringLength = 50, IsNullable = false, CanUpdate = false)]
        public string Salt { get; set; }

        /// <summary>
        /// 真实姓名
        /// </summary>
        [Column(StringLength = 50)]
        public string RealName { get; set; }

        /// <summary>
        /// 电话号码
        /// </summary>
        [Column(StringLength = 20)]
        public string TelPhone { get; set; }

        /// <summary>
        /// 邮箱地址
        /// </summary>
        [Column(StringLength = 50)]
        public string Email { get; set; }

        /// <summary>
        /// 是否锁定
        /// </summary>
        public int IsLock { get; set; } = 0;

        /// <summary>
        /// 添加时间
        /// </summary>
        [Column(CanUpdate = false)]
        public DateTime AddTime { get; set; } = DateTime.Now;

        [Navigate(nameof(Id))]
        public virtual ManagerRoleEntity ManagerRole { get; set; }
    }
}
